#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->name->setPlaceholderText("请输入姓名");
    ui->name->setClearButtonEnabled(true);
    ui->passworld->setPlaceholderText("请输入密码");
    ui->passworld->setClearButtonEnabled(true);
    ui->passworld->setEchoMode(QLineEdit::Password);
    ui->phone->setPlaceholderText("请输入电话");
    ui->phone->setInputMask("000-0000-0000");
}

Widget::~Widget()
{
    delete ui;

}


void Widget::on_pushButton_clicked()
{
    QString ret = ui->man->isChecked() ? "男" : "女";
    qDebug() << "姓名" << ui->name->text() << endl;
    qDebug() << "密码" << ui->passworld->text() << endl;
    qDebug() << "性别" << ret << endl;
    qDebug() << "电话" << ui->phone->text() << endl;
}
